home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 2 / CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso / magazine / amiga_e / epp / pmodules / skipwhite.e < prev    next >
Text File  |  1980-01-05  |  714b  |  20 lines

  1. OPT TURBO
  2.  
  3. PROC skipWhite(theString:PTR TO CHAR, startPos)
  4.   DEF length
  5.   /* Skips SPACE, TAB, LF, CR.  Returns endPos so that                    */
  6.   /* MidStr (someString, theString, startPos, (endPos - startPos)) can be */
  7.   /* used in the calling program.                                         */
  8.   /* Return of -1 indicates access beyond end of string.                  */
  9.   length:=StrLen(theString)
  10.   IF startPos>=length THEN RETURN startPos
  11.   WHILE (startPos<length) AND
  12.         ((theString[startPos]=" ") OR
  13.          (theString[startPos]=9)   OR /* TAB */
  14.          (theString[startPos]=10)  OR /* LF */
  15.          (theString[startPos]=13))    /* CR */ DO INC startPos
  16.  
  17. ENDPROC startPos
  18.   /* skipWhite */
  19.  
  20.